import org.junit.Test;

public class StringMethod {
    @Test
    public void test() {
        String str1 = "";
        System.out.println("是否为空："+ str1.isEmpty());

        //去除前后空格
        String str2 = " he  llo  ";
        System.out.println(str2);
        System.out.println(str2.trim());

        //比较和忽略大小比较
        String str3 = "Aa";
        String str4 = "aa";
        System.out.println(str3.equals(str4));
        System.out.println(str3.equalsIgnoreCase(str4));

        String str5 = "abcd";
        String str6 = "Abcf";

        System.out.println(str5.compareTo(str6));
        System.out.println(str5.compareToIgnoreCase(str6));

        String str7 = "张ab";
        String str8 = "李ab";
        System.out.println(str7.compareTo(str8));

        String str9 = "AbdsDDS";
        System.out.println(str9.toUpperCase());
        System.out.println(str9.toLowerCase());
    }
}
